package com.xjh.him.core;

import com.xuexiang.xhttp2.model.ApiResult;

public class HimApiResult<T> extends ApiResult<T> {
    private Boolean success;
    private String errMsg;
    private T result;

    @Override
    public int getCode() {
        return success ? 0 : -1;
    }

    @Override
    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(Boolean success) {
        this.success = success;
    }

    @Override
    public String getMsg() {
        return errMsg;
    }

    public void setErrMsg(String errMsg) {
        this.errMsg = errMsg;
    }

    @Override
    public T getData() {
        return result;
    }

    public void setResult(T result) {
        this.result = result;
    }

    @Override
    public String toString() {
        return "HimApiResult{" +
                "success=" + success +
                ", errMsg='" + errMsg + '\'' +
                ", result=" + result +
                '}';
    }
}
